//
//  oldBaseTableViewController.m
//  laonianbang
//
//  Created by 勇拓 李 on 17/10/9.
//  Copyright © 2017年 zaiyou. All rights reserved.
//

#import "oldBaseTableViewController.h"

@interface oldBaseTableViewController ()

@end

@implementation oldBaseTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc]init];
    backItem.title = @" ";
    self.navigationItem.backBarButtonItem = backItem;
    
    self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];//隐藏空的 cell
    
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    //    self.automaticallyAdjustsScrollViewInsets = NO;//去掉tableview上方的空白
    self.tableView.backgroundColor = Color_With_Rgb(247, 247, 247, 1);
    
}

- (void)setBackBtn
{
    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    [btn addTarget:self action:@selector(gotoBack) forControlEvents:UIControlEventTouchUpInside];
    [btn setImage:[UIImage imageNamed:@"返回"] forState:UIControlStateNormal];
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc ] initWithCustomView:btn];
    self.navigationItem.leftBarButtonItem = backItem;
}

- (void)setRightBtn:(NSString *)name
{
    UIButton *rightbutton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 40, 20)];
    
    //[leftbutton setBackgroundColor:[UIColor blackColor]];
    
    [rightbutton setTitle:name forState:UIControlStateNormal];
    
    [rightbutton addTarget:self action:@selector(btn_right_tapped) forControlEvents:UIControlEventTouchDown];
    
    UIBarButtonItem *rightitem = [[UIBarButtonItem alloc]initWithCustomView:rightbutton];
    
    self.navigationItem.rightBarButtonItem = rightitem;
}

- (void)btn_right_tapped
{
    
}

- (void)gotoBack
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)rigisterCell:(NSString *)identifier
{
    [self.tableView registerNib:[UINib nibWithNibName:identifier bundle:nil] forCellReuseIdentifier:identifier];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
